<div id="enterPwd" style="display:none">
    <!--class="ui-dialog"-->
    <form id="enterPwdForm">
        <div>
            密码：
            <input type="password" value='' id="pwd"/>
        </div>
        <input id='hideuid' type="hidden"/>
    </form>
</div>
<script type="text/javascript">
    $('#enterPwd').on('keypress',function(e){
        e = e || window.event;
        if(13 == e.keyCode){
            var uid = $("#hideuid").attr('data');
            aa(uid);
            e.returnValue = false
            return false
        }
    });
    var uid = '{{info['uid']}}';
    enterPwd(uid);
    function enterPwd(uid){
        var postData = {};
        postData.type = 0;
        $.ajax({
            type:"POST",
            data:postData,
            url:'/ajax/checkHasAuth',
            dataType:'json',
            success:function(res){
                if(res.code == 0){
                    $("#content").removeClass('hidden');
                }else{
                    // var pwd = window.prompt("输入密码", "");
                    // aa(uid,pwd);
                    $('#enterPwd').dialog({
                        autoOpen:true,
                        width:320,
                        height:180,
                        title:'输入密码',
                        resizable:false,
                        modal:true,
                        open:function(){
                            $('#hideuid').attr('data',uid);
                        },
                        buttons: {
                            "确定": function () {
                                // $(".ui-dialog-titlebar-close").click();
                                aa(uid);
                            }
                        }
                    });
                }
            }
        });
    }
    function aa(uid,pwd){
        var data={};
        data.pwd = $('#pwd').val();
        data.type = 0;
        $.ajax({
            type:"POST",
            data:data,
            url:'/ajax/checkAnchorPwd',
            dataType:'json',
            success:function(res){
                if(res.code == 0){
                    location.reload();
                }else{
                    if(confirm(res.info) == false){
                        $("#content").addClass('hidden');
                    }else{
                        $("#content").addClass('hidden');
                    }
                }
            }
        });
    }
</script>
<div id="breadcrumb">
    <a onclick="javascript:history.go(-1);" class="go-to-home tip-bottom font font18" style="cursor: pointer;"> <i class="icon-arrow-left"></i>
        返回 &nbsp;
    </a>
    <a onclick="javascript:history.go(-1);" class="font font18" style="cursor: pointer;">
        &nbsp;&nbsp;
        <span>主播 &gt</span>
    </a>
    <a onclick="javascript:history.go(-1);" class="font font18" style="cursor: pointer;">
        <span>{{info['signStatus']}}&gt</span>
    </a>
    <a href="/anchor/anchorinfo?uid={{info['uid']}}" class="current font font18">
        <span>主播详情</span>
    </a>
</div>

<!--sidebar-menu-->
<div id="sidebar" class="clearfix">
    <div class="user-info">
        <img alt="" src="{{info['avatar']}}">
        <p>
            <span class="font font20 cr-dpe">{{info['nickName']}}</span>
        </p>
        <p>
            <span class="font font20 cr-dpe">{{info['uid']}}</span>
            <input id="in_uid" type="hidden" value="{{info['uid']}}"></p>
        <p>
            <span class="i-actor sprite-zb_level zb{{info['level2']}}"></span>
            <span class="font font20 cr-dpe">{{info['levelName']}}</span>
        </p>
        <p>
            <span class="font font20 cr-dpe">
                {{info['signStatus']}}
                {% if info['signStatus']=='已签约' and !familyId and info['status'] != 4 %}
                <button class="btn" onclick="unbind({{info['uid']}})">解约</button>
                {% endif %}
            </span>
        </p>
    </div>
    <div class="progtrckr-box" style="top:260px;">
        <div class="progtrckrline" ></div>
        <ul class="progtrckr" style="width: 212px;">
            <li class="active"> <i class="custom-icon custom-icon-point"></i>
                <a href="/anchor/anchorinfo?uid={{info['uid']}}">个人资料</a>
            </li>
            <li>
                <i class="custom-icon custom-icon-point"></i>
                <a href="/anchor/income?uid={{info['uid']}}">收益</a>
            </li>
            <li>
                <i class="custom-icon custom-icon-point"></i>
                <a href="/anchor/contribute?uid={{info['uid']}}">贡献</a>
            </li>
            <li>
                <i class="custom-icon custom-icon-point"></i>
                <a href="/anchor/trend?uid={{info['uid']}}">趋势分析</a>
            </li>
            <li>
                <i class="custom-icon custom-icon-point"></i>
                <a href="/anchor/worktable?uid={{info['uid']}}">导出工作情况表</a>
            </li>
        </ul>
    </div>
</div>
<!--end sidebar-menu-->

<div id="content" class="hidden">
    <div class="container-fluid">
        <div class="row-fluid" style="margin-top: 60px; min-width: 900px;  ">
            <div class="thum-box box span6" style="float: left;width: 60%">
                <div style="/*margin: 0 auto;*/ width: 100%;">
                    <div class="thum-top clearfix" style="width:100%;">
                        <div class="title">
                            <p style="margin-top: 15px">
                                <span>状态</span>
                            </p>
                        </div>
                    </div>
                    <div class="thum-content clearfix" style="width: 100%;font-size: 20px;height: 90px;">
                        <div  style="border-right: 1px dashed #cccccc;float: left;width: 49%;height: 45px;margin-top: -8px;line-height: 45px;">
                            <div class="pull-left">
                                <span style="margin-left: 20px;">直播：</span>
                                {% if statusInfo['data']['liveStatus']==-1 %}
                                <span style="margin-right: 10px;font-size: 25px;font-weight: bold;">没有房间</span>
                                {% endif %}

                                {% if statusInfo['data']['liveStatus']==0 %}
                                <span style="margin-right: 10px;font-size: 25px;font-weight: bold;">正常</span>
                                {% endif %}

                                {% if statusInfo['data']['liveStatus']==1 %}
                                <span style="margin-right: 10px;font-size: 25px;font-weight: bold;">正常</span>
                                {% endif %}

                                {% if statusInfo['data']['liveStatus']==2 %}
                                <span style="margin-right: 10px;font-size: 25px;font-weight: bold;">禁播</span>
                                {% endif %}
                            </div>
                            <span class="pull-right" style="margin-right: 10px;">
                                {% if statusInfo['data']['liveStatus']==-1 %}
                                <button class="btn btn-grey" style="display: none;"></button>
                                {% endif %}

                                {% if statusInfo['data']['liveStatus']==0 %}
                                <button class="btn" onclick="ban(2)">禁播</button>
                                {% endif %}

                                {% if statusInfo['data']['liveStatus']==1 %}
                                <button class="btn" onclick="ban(2)">禁播</button>
                                {% endif %}

                                {% if statusInfo['data']['liveStatus']==2 %}
                                <button class="btn" onclick="ban(0)">解禁</button>
                                {% endif %}
                            </span>
                        </div>
                        <div style="float: left;width: 49%;height: 45px;margin-top: -8px;line-height: 45px;">
                            <div class="pull-left">
                                <span style="margin-left: 20px;">账号：</span>
                                {% if statusInfo['data']['userStatus']==1 %}
                                <span style="margin-right: 10px;font-size: 25px;font-weight: bold;">正常</span>
                                {% endif %}

                                {% if statusInfo['data']['userStatus']==2 %}
                                <span style="margin-right: 10px;font-size: 25px;font-weight: bold;">冻结</span>
                                {% endif %}
                            </div>
                            <span class="pull-right" style="margin-right: 10px;">
                                {% if statusInfo['data']['userStatus']==1 %}
                                <button class="btn" onclick="frozen(2)">冻结</button>
                                {% endif %}

                                {% if statusInfo['data']['userStatus']==2 %}
                                <button class="btn" onclick="frozen(1)">解冻</button>
                                {% endif %}
                            </span>
                        </div>
                        {% if statusInfo['data']['showStatus']==-1 %}
                        <div class="pull-left" style="margin:20px 0 0 20px;display: none">
                            <input id="checked" type="checkbox" class="pull-left">
                            <p class="pull-left">直播房间不显示（网站首页及推荐等）</p>
                        </div>
                        {% endif %}

                        {% if statusInfo['data']['showStatus']==0 %}
                        <div class="pull-left" style="margin:20px 0 0 20px;">
                            <input id="checked" type="checkbox" checked="checked" class="pull-left" onclick="showroom()">
                            <p class="pull-left">直播房间不显示（网站首页及推荐等）</p>
                        </div>
                        {% endif %}

                        {% if statusInfo['data']['showStatus']==1 %}
                        <div class="pull-left" style="margin:20px 0 0 20px;">
                            <input id="checked" type="checkbox" class="pull-left" onclick="showroom()">
                            <p class="pull-left">直播房间不显示（网站首页及推荐等）</p>
                        </div>
                        {% endif %}
                    </div>
                </div>
            </div>

            <div class="thum-box span4" style="float: left;width: 30%;">
                <div class="pull-right">
                    <div class="thum-top bl clearfix">
                        <div class="title bl">
                            <p style="margin-top: 15px">
                                <span>家族</span>
                            </p>
                            <p>
                                <span></span>
                            </p>
                        </div>
                    </div>

                    <div class="thum-content "  {%if info['familyId']%}style="padding-top: 2px;"{%endif%}>
                        <p class="font font20 cr-e5" {%if info['familyId']%}style=" margin: 0 0 2px;"{%endif%}>

                            <span>
                                {%if info['familyId']%}
                                <a href="/agent/familyinfo?id={{info['familyId']}}">
                                    <img class="radius" style="width: 50px; height: 50px;" src="{{info['familyLogo']}}">{{info['familyName']}}</a>
                                {%else%}无家族{%endif%}
                            </span>
                        </p>
                    </div>
                </div>
            </div>
        </div>

        <div class="row-fluid" style="margin-top: 40px;">
            <div class="span8" style="width: 66%;float: left">
                <div class="content-box" style="background: #FFF; text-align: left;  padding-bottom: 40px;">
                    <div style="height:40px;border-bottom:2px solid #cccccc;margin: 0 10px; ">
                        <div style="height: 40px;border-bottom:2px solid #817cce;width: 100px;color:#817cce;text-align: center;line-height: 40px;font-size: 16px; ">基础信息</div>
                    </div>
                    <div class="ct-anchorinfo">
                        <div class="l-row">
                            <span class="lable font font16 cr-b9">真实姓名:</span>
                            <span class="font font16">{{info['realName']}}</span>
                        </div>

                        <div class="l-row">
                            <span class="lable font font16 cr-b9">性别:</span>
                            {% if info['gender']== 0 %}
                            <span class="font font16">女</span>
                            {% endif %}
                            {% if info['gender']== 1 %}
                            <span class="font font16">男</span>
                            {% endif %}
                        </div>

                        <div class="l-row">
                            <span class="lable font font16 cr-b9">生日:</span>
                            <span class="font font16">{{info['birthday']}}</span>
                        </div>

                        <div class="l-row">
                            <span class="lable font font16 cr-b9">籍贯:</span>
                            <span class="font font16">{{info['birth']}}</span>
                        </div>

                        <div class="l-row">
                            <span class="lable font font16 cr-b9">身份证号:</span>
                            <span class="font font16">{{info['idCard']}}</span>
                        </div>

                        <div class="l-row">
                            <span class="lable font font16 cr-b9">电话:</span>
                            <span class="font font16">{{info['telephone']}}</span>
                        </div>

                        <div class="l-row">
                            <span class="lable font font16 cr-b9">地址:</span>
                            <span class="font font16">{{info['address']}}</span>
                        </div>

                        <div class="l-row">
                            <span class="lable font font16 cr-b9">QQ:</span>
                            <span class="font font16">{{info['qq']}}</span>
                        </div>

                        <div class="l-row">
                            <span class="lable font font16 cr-b9">开户行:</span>
                            <span class="font font16">{{info['bank']}}</span>
                        </div>

                        <div class="l-row">
                            <span class="lable font font16 cr-b9">银行开户姓名:</span>
                            <span class="font font16">{{info['accountName']}}</span>
                        </div>

                        <div class="l-row">
                            <span class="lable font font16 cr-b9">银行卡号:</span>
                            <span class="font font16">{{info['cardNumber']}}</span>
                        </div>

                        <div class="l-row" style="height: 107px; position: relative;">
                            <span class="lable font font16 cr-b9" style="position:absolute; margin-top: 40px">生活照:</span>
                            <div style="position: relative;">
                                <div class="photo clearfix">
                                    {% if info['lifePhotoList'] %}
                                    {% for photo in info['lifePhotoList'] %}
                                    <a rel="example_group" href="{{photo['photoUrl']}}" title="">
                                        <img alt="" src="{{photo['photoUrl']}}" style="width: 154px;height: 107px;"></a>
                                    {% endfor %}
                                    {% endif %}
                                </div>
                            </div>
                        </div>

                        <div class="l-row" style="height: 107px; position: relative;">
                            <span class="lable font font16 cr-b9" style="position:absolute; margin-top: 40px">证件照:</span>
                            <div style="position: relative;">
                                <div class="photo clearfix">
                                    {% if info['idCardPhotoList'] %}
                                    {% for phone in info['idCardPhotoList'] %}
                                    <a rel="example_group" href="{{phone['photoUrl']}}" title="">
                                        <img alt="" src="{{phone['photoUrl']}}" style="width: 154px;height: 107px;"></a>
                                    {% endfor %}
                                    {% endif %}
                                </div>
                            </div>
                        </div>

                    </div>

                </div>
            </div>
            <div class="span4" style="width: 30%;float: left; background-color: #ffffff;">
                <div class="content-box" style="background: #FFF; text-align: left;  padding-bottom: 40px;min-height: 825px;">
                    <div style="height:40px;border-bottom:2px solid #cccccc;margin: 0 10px; ">
                        <div style="height: 40px;border-bottom:2px solid #817cce;width: 100px;color:#817cce;text-align: center;line-height: 40px;font-size: 16px; ">家族履历</div>
                    </div>
                    <div class="jz-anchorinfo">
                        {% if info['familyList']['list'] %}
                        {% for familyinfo in info['familyList']['list'] %}
                        <div class="clearfix" style="height: 80px;width: 500px;border-bottom:1px dashed #cccccc; margin: 0 auto;padding: 1px;">
                            <div style="height: 70px;width: 120px;border-right: 1px dashed #cccccc;margin-top: 5px;float: left">
                                <span style="width: 120px;text-align: center;font-size: 14px;display:inline-block ">{{familyinfo['joinTime']}}</span>
                                <span style="width: 120px;text-align: center;font-size: 14px;display:inline-block ">至</span>
                                <span style="width: 120px;text-align: center;font-size: 14px;display:inline-block ">{{familyinfo['outOfTime']}}</span>
                            </div>
                            <div style="width: 378px;float: left">
                                <div style="margin: 5px 0 0 20px;">
                                    <img src="{{familyinfo['logo']}}" style="border-radius: 50px;height: 30px;width: 30px;border: 1px solid #cccccc;">
                                    <span style="margin: 5px 0 0 20px;font-size: 16px;">{{familyinfo['name']}}</span>
                                </div>
                                <div style="height: 40px;line-height: 40px;font-size: 16px;">
                                    <span style="margin-left: 20px;">创造收益：</span>
                                    <span>{{familyinfo['cash']}}</span>
                                </div>
                            </div>
                        </div>
                        {% endfor %}
                        {%else%}
                        <p class="font font20 cr-b9" style="height:120px; line-height: 120px; text-align: center;">该主播没有加入过家族</p>
                        {% endif %}
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript" src="{{static_url('web/js/jquery.fancybox-1.3.1.js')}}"></script>
<script type="text/javascript" src="{{static_url('web/js/91ns.anchor1.js')}}"></script>
<link rel="stylesheet" href="{{static_url('web/css/jquery.fancybox-1.3.1.css')}}" type="text/css" />
<link rel="stylesheet" href="{{static_url('web/css/icon/style-icon.css')}}">
<script type="text/javascript">
    $(function() {
        $('body').addClass('anchorinfo');

        $("a[rel=example_group]").fancybox({
            'transitionIn'      : 'none',
            'transitionOut'     : 'none',
            'titlePosition'     : 'over',
            'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
                return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
            }
        });
    });
    function ban(status){
        var uid=$('#in_uid').val();
        var data={};
        data.uid=uid;
        data.status=status;
        $.ajax({
            type: "POST",
            data: data,
            url: '/ajax/liveStatus',
            dataType: 'json',
            success: function (res) {
                location.reload();
            }
        })
    }

    function frozen(status){
        var uid=$('#in_uid').val();
        var data={};
        data.uid=uid;
        data.status=status;
        $.ajax({
            type: "POST",
            data: data,
            url: '/ajax/userStatus',
            dataType: 'json',
            success: function (res) {
                location.reload();
            }
        })
    }

    function showroom(){
        var uid=$('#in_uid').val();
        var data={};
        data.uid=uid;
        if($("#checked").attr("checked")=='checked'){
            data.status=0;
        }
        else{
            data.status=1;
        }
        $.ajax({
            type: "POST",
            data: data,
            url: '/ajax/showStatus',
            dataType: 'json',
            success: function (res) {
                location.reload();
            }
        })
    }
</script>